<template>
    <div>
        <h3>child子组件部分</h3>
        <input type="text" v-model="message">
        <button @click="sendMsgToParend" style="margin:auto">向父组件传值</button>
    </div>
</template>
<script>
export default {
    data(){
        return{
            message:null
        }
    },
    methods:{
        sendMsgToParend:function(){
            this.$emit('listenToChildEvent',this.message);
            this.message=null
        }
    }
}
</script>

<style lang="sass" scoped>

</style>